<?php

namespace app\api\model;

use think\Model;

class Lottery extends Model
{
    public function getStatusAttr($value){
        $status = [
            '3'     =>  '未开启',
            '1'     =>  '正在进行',
            '2'     =>  '已关闭',
        ];
        return $status[$value];
    }
    public function getPrizeAttr($val){
        return json_decode($val,true);
    }
    public function getPalmAttr($val,$data){
        return json_decode($val,true);
    }
    public function getStartTimeAttr($val){
        return date('Y-m-d H:i:s',$val);
    }
    public function getEndTimeAttr($val){
        return date('Y-m-d H:i:s',$val);
    }

}